﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using Wolfut.MirageEE.Core.Service;
using Wolfut.MirageEE.Core.Test.Dao;

namespace Wolfut.MirageEE.Core.Test.Service
{
    public class PersonService : BaseService
    {
        #region Private Fields

        private IPersonDAO personDao;
        #endregion

        #region Constructor
        private PersonService()
            : base()
        {
            //productDao = daoManager[typeof (IProductDao)] as IProductDao;
            personDao = daoManager[typeof(IPersonDAO)] as IPersonDAO;

        }
        private PersonService(string context)
            : base(context)
        {
            //productDao = daoManager[typeof (IProductDao)] as IProductDao;
            personDao = daoManager[typeof(IPersonDAO)] as IPersonDAO;

        }
        public static PersonService GetPersonService(string contextName)
        {
            return new PersonService(contextName);
        }
        public static PersonService GetPersonService()
        {
            return GetPersonService("SqlMapDao");
        }
        #endregion

        #region Category
        public IList GetPersonList()
        {
            return personDao.QueryPersons();
        }

     
        #endregion
    }
}
